var v = new Vue({
    el:"#app",
    data:{
        types:['全部','喜剧','动作','动画','科幻'],
        areas:['全部','内地','美国','日本'],
        years:['全部','2023','2022','2021','2020','10年代','00年代'],
        moviename:"",
        pageSize:16,
        page:1,
        total:0,
        moviesdata:{},
        tuijiandata:{},
        type:'全部',
        area:'全部',
        year:'全部',
        loading:'true',
        userMsg:{userid:""},
        linksdata:{},
    },
    created(){
        this.getUserMsg();
        this.query(1);
        this.queryTuijian();
        this.queryLinks();
    },
    methods:{
        queryTuijian(){
            axios.get("tuijianServlet.s").then(res=>{
                this.tuijiandata=res.data;
            });
        },
        query(page){
            axios.get('UserQueryMovieServlet.s',{
                params:{
                    currentPage:page,
                    moviename:this.moviename,
                    type: this.type,
                    area:this.area,
                    moviedate:this.year
                }
            }).then(res=>{
                 this.moviesdata=res.data.data.data;
                 this.total=parseInt(res.data.data.total);
            });
        },

        getUserMsg(){
            axios.get("GetUserMessageServlet.s").then(res=>{
                if (res.data.data!=null){
                    this.userMsg=res.data.data;
                }
            });
        },
        queryLinks(){
            axios.get("UserQueryLinksServlet.s").then(res=>{
                this.linksdata=res.data;
            })
        }
    }

});